import request from '@/utils/request'

// 客户信息
export function customer(query) {
  return request({
    url: '/erp_api/zhouyz/customer/list',
    method: 'get',
    params: query
  })
}

// 客户详情
export function customerInfo(query) {
  return request({
    url: `/erp_api/zhouyz/customer/${query.id}`,
    method: 'get'
  })
}

// 客户地址
export function customerAllAddr(query) {
  return request({
    url: `/erp_api/zhouyz/customer/all-customer-addr/${query.id}`,
    method: 'get'
  })
}

// 编辑客户
export function customerAdd(data) {
  return request({
    url: '/erp_api/zhouyz/customer',
    method: data.id ? 'put' : 'post',
    data: data
  })
}


// 重置密码
export function customerPassword(data) {
  return request({
    url: '/erp_api/zhouyz/customer/password',
    method: 'put',
    data: data
  })
}

// 删除客户
export function customerDel(data) {
  return request({
    url: `/erp_api/zhouyz/customer/${data.id}`,
    method: 'delete'
  })
}

// 设定为批发商
export function customerWholesaler(query) {
  return request({
    url: `/erp_api/zhouyz/customer/wholesaler-by-id/${query.id}/${query.wholesaler}`,
    method: 'get'
  })
}

// 资料审核
export function customerExamine(query) {
  return request({
    url: `/erp_api/zhouyz/customer/examine-by-id/${query.id}`,
    method: 'get'
  })
}

// 跟进记录
export function customerFollowRecord(query) {
  return request({
    url: '/erp_api/zhouyz/customerFollowRecord/list',
    method: 'get',
    params: query
  })
}

// 积分明细
export function integralDetail(query) {
  return request({
    url: '/erp_api/zhouyz/integralDetail/list',
    method: 'get',
    params: query
  })
}

// 会员等级
export function customerLevel(query) {
  return request({
    url: '/erp_api/zhouyz/customerLevel/list',
    method: 'get',
    params: query
  })
}

// 客户地址
export function customerAddr(query) {
  return request({
    url: '/erp_api/zhouyz/customerAddr/list',
    method: 'get',
    params: query
  })
}

// 地址详情
export function customerAddrDetail(query) {
  return request({
    url: `/erp_api/zhouyz/customerAddr/${query.id}`,
    method: 'get'
  })
}
